You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.
We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us
• Fix the "Error: ConnectFailure (Connection refused)" issue when instantiating ChromeDriver multiple times
Requires further human verification:
• Issue occurs on Ubuntu 16.04.4 with Linux 4.10.0
• Affects Selenium 3.9.0 with Chrome 65.0.3325.181 and ChromeDriver 2.35
• First ChromeDriver instance works fine, but subsequent instances fail
New methods have been added with @deprecated annotations on old methods, but there's no implementation to forward calls from old methods to new ones, which could break existing code that relies on these listeners.
@DeprecateddefaultvoidbeforeSetScriptTimeout(WebDriver.Timeoutstimeouts, Durationduration) {}
/** * This action will be performed each time before {@link * WebDriver.Timeouts#scriptTimeout(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method */defaultvoidbeforeScriptTimeout(WebDriver.Timeoutstimeouts, Durationduration) {}
/** * This action will be performed each time after {@link * WebDriver.Timeouts#scriptTimeout(Duration)} is called. * * @param timeouts The timeouts object that will be called * @param duration The duration that will be passed to the method * @deprecated Use {@link #afterScriptTimeout(WebDriver.Timeouts, Duration)} instead. */@DeprecateddefaultvoidafterSetScriptTimeout(WebDriver.Timeoutstimeouts, Durationduration) {}
Latest suggestions up to 5778160
Explore these optional code suggestions:
Category
Suggestion
Impact
Possible issue
Add backward compatibility delegation
The new beforeScriptTimeout method should delegate to the deprecated beforeSetScriptTimeout method to maintain backward compatibility during transition. This ensures existing implementations continue to work while users migrate to the new method.
Why: Delegating the new beforeScriptTimeout method to the deprecated beforeSetScriptTimeout method is a sound approach for backward compatibility, ensuring existing user implementations continue to function. This is a maintainability improvement but not critical, as it does not affect core functionality.
The new beforeScriptTimeout method should delegate to the deprecated beforeSetScriptTimeout method to maintain backward compatibility during transition. This ensures existing implementations continue to work while users migrate to the new method.
Why: Delegating the new beforeScriptTimeout method to the deprecated beforeSetScriptTimeout ensures backward compatibility, which is important for users transitioning to the new API. This is a solid maintainability improvement, though not critical for correctness.
Medium
Learned best practice
Fix inconsistent deprecation message
The deprecated method reference in the Javadoc comment for afterSetScriptTimeout is inconsistent. It refers to afterScriptTimeout but the method being deprecated is afterSetScriptTimeout. This creates confusion for developers migrating to the new API.
default void beforeScriptTimeout(WebDriver.Timeouts timeouts, Duration duration) {}
/**
* This action will be performed each time after {@link
* WebDriver.Timeouts#scriptTimeout(Duration)} is called.
*
* @param timeouts The timeouts object that will be called
* @param duration The duration that will be passed to the method
- * @deprecated Use {@link #afterScriptTimeout(WebDriver.Timeouts, Duration)} instead.+ * @deprecated This method is deprecated and will be removed. Use {@link #afterScriptTimeout(WebDriver.Timeouts, Duration)} instead.
*/
@Deprecated
default void afterSetScriptTimeout(WebDriver.Timeouts timeouts, Duration duration) {}
Suggestion importance[1-10]: 6
__
Why:
Relevant best practice - Fix inconsistent error messages and validation logic. Ensure error messages are clear, accurate, and provide specific information about the error condition and expected values.
Failed test name: //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions
Failure summary:
The action failed because the test //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions timed out after 1800 seconds (30 minutes). This was the only failing test out of 66 total tests. The test was running for an extended period without completing, causing the build to fail.
Relevant error logs:
1: ##[group]Operating System2: Microsoft Windows Server 2022
...
510: gpg: setting ownertrust to 4511: gpg: setting ownertrust to 4512: gpg: setting ownertrust to 4513: gpg: setting ownertrust to 4514: ==> Disabling revoked keys in keyring...515: -> Disabled 4 keys.516: ==> Updating trust database...517: gpg: marginals needed: 3 completes needed: 1 trust model: pgp518: gpg: depth: 0 valid: 1 signed: 5 trust: 0-, 0q, 0n, 0m, 0f, 1u519: gpg: depth: 1 valid: 5 signed: 7 trust: 0-, 0q, 0n, 5m, 0f, 0u520: gpg: depth: 2 valid: 4 signed: 2 trust: 4-, 0q, 0n, 0m, 0f, 0u521: gpg: next trustdb check due at 2025-08-13522: �[32mAnalyzing:�[0m 66 targets (313 packages loaded, 7660 targets configured)523: �[32mAnalyzing:�[0m 66 targets (339 packages loaded, 8147 targets configured)524: �[35mWARNING: �[0mD:/_bazel/external/io_bazel_rules_closure/java/com/google/javascript/jscomp/BUILD:19:13: in java_library rule @@io_bazel_rules_closure//java/com/google/javascript/jscomp:jscomp: target '@@io_bazel_rules_closure//java/com/google/javascript/jscomp:jscomp' depends on deprecated target '@@io_bazel_rules_closure//java/io/bazel/rules/closure:build_info_java_proto': Use java_proto_library from com_google_protobuf525: gpg: error retrieving 'alexey.pawlow@gmail.com' via WKD: No data526: gpg: error reading key: No data527: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com528: �[32mAnalyzing:�[0m 66 targets (361 packages loaded, 8844 targets configured)529: gpg: key F40D263ECA25678A: "Alexey Pavlov (Alexpux) <alexey.pawlow@gmail.com>" not changed530: gpg: Total number processed: 1531: gpg: unchanged: 1532: gpg: error retrieving 'david.macek.0@gmail.com' via WKD: No data533: gpg: error reading key: No data534: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com535: gpg: key 790AE56A1D3CFDDC: "David Macek (MSYS2 master key) <david.macek.0@gmail.com>" not changed536: gpg: Total number processed: 1537: gpg: unchanged: 1538: gpg: error retrieving 'martellmalone@gmail.com' via WKD: No data539: gpg: error reading key: No data540: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com541: gpg: key DA7EF2ABAEEA755C: "Martell Malone (martell) <martellmalone@gmail.com>" not changed542: gpg: Total number processed: 1543: gpg: unchanged: 1544: gpg: error retrieving 'reiter.christoph@gmail.com' via WKD: No data545: gpg: error reading key: No data546: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com547: gpg: key 755B8182ACD22879: "Christoph Reiter (MSYS2 master key) <reiter.christoph@gmail.com>" not changed548: gpg: Total number processed: 1549: gpg: unchanged: 1550: gpg: error retrieving 'icquinteiro@gmail.com' via WKD: No data551: gpg: error reading key: No data552: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com553: gpg: key 9F418C233E652008: "Ignacio Casal Quinteiro <icquinteiro@gmail.com>" not changed554: gpg: Total number processed: 1555: gpg: unchanged: 1556: gpg: error retrieving 'mingw.android@gmail.com' via WKD: No data557: gpg: error reading key: No data558: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com559: gpg: key BBE514E53E0D0813: "Ray Donnelly (MSYS2 Developer - master key) <mingw.android@gmail.com>" not changed560: gpg: Total number processed: 1561: gpg: unchanged: 1562: gpg: error retrieving 'alexpux@gmail.com' via WKD: No data563: gpg: error reading key: No data564: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com565: gpg: key 5F92EFC1A47D45A1: "Alexey Pavlov (Alexpux) <alexpux@gmail.com>" not changed566: gpg: Total number processed: 1567: gpg: unchanged: 1568: gpg: error retrieving 'david.macek.0@gmail.com' via WKD: No data569: gpg: error reading key: No data570: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com571: gpg: key 974C8BE49078F532: "David Macek <david.macek.0@gmail.com>" not changed572: gpg: Total number processed: 1573: gpg: unchanged: 1574: gpg: error retrieving 'reiter.christoph@gmail.com' via WKD: No data575: gpg: error reading key: No data576: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com577: gpg: key FA11531AA0AA7F57: "Christoph Reiter (MSYS2 development key) <reiter.christoph@gmail.com>" not changed578: gpg: Total number processed: 1579: gpg: unchanged: 1580: gpg: error retrieving 'me@martellmalone.com' via WKD: General error581: gpg: error reading key: General error582: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com583: gpg: key 794DCF97F93FC717: "Martell Malone (martell) <me@martellmalone.com>" not changed584: gpg: Total number processed: 1585: gpg: unchanged: 1586: gpg: error retrieving 'martellmalone@gmail.com' via WKD: No data587: gpg: error reading key: No data588: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com589: gpg: key D595C9AB2C51581E: "Martell Malone (MSYS2 Developer) <martellmalone@gmail.com>" not changed590: gpg: Total number processed: 1591: gpg: unchanged: 1592: gpg: error retrieving 'mingw.android@gmail.com' via WKD: No data593: gpg: error reading key: No data594: gpg: refreshing 1 key from hkps://keyserver.ubuntu.com
...
706: AccessController.doPrivileged(707: ^708: �[32mINFO: �[0mFrom Compiling absl/base/log_severity.cc [for tool]:709: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'710: �[32mINFO: �[0mFrom Compiling absl/base/internal/raw_logging.cc [for tool]:711: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'712: �[32mINFO: �[0mFrom Compiling absl/types/bad_optional_access.cc [for tool]:713: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'714: �[32m[507 / 1,157]�[0m Copying files; 0s local ... (3 actions, 1 running)715: �[32mINFO: �[0mFrom Compiling absl/types/bad_variant_access.cc [for tool]:716: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'717: �[32mINFO: �[0mFrom Compiling absl/profiling/internal/exponential_biased.cc [for tool]:718: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'719: �[32mINFO: �[0mFrom Compiling absl/strings/internal/cordz_functions.cc [for tool]:720: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'721: �[32mINFO: �[0mFrom Compiling absl/base/internal/strerror.cc [for tool]:722: cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
...
1984: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1493s local, disk-cache1985: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1553s local, disk-cache1986: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1614s local, disk-cache1987: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1674s local, disk-cache1988: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1734s local, disk-cache1989: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1794s local, disk-cache1990: �[32m[1,267 / 1,268]�[0m 65 / 66 tests;�[0m Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions; 1800s local, disk-cache1991: �[31m�[1mTIMEOUT: �[0m//rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions (Summary)1992: ==================== Test output for //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions:1993: D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rb/spec/unit/selenium/webdriver/common/interactions/pointer_actions/test.log1994: ================================================================================1995: �[32mINFO: �[0mFrom Testing //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions:1996: �[32mINFO: �[0mFound 66 test targets...1997: �[32mINFO: �[0mElapsed time: 2374.038s, Critical Path: 2241.31s1998: �[32mINFO: �[0m1268 processes: 552 disk cache hit, 575 internal, 141 local.1999: �[32mINFO: �[0mBuild completed, 1 test FAILED, 1268 total actions2000: //rb/spec/unit/selenium:devtools �[0m�[32mPASSED�[0m in 5.0s
...
2052: //rb/spec/unit/selenium/webdriver/ie:service �[0m�[32mPASSED�[0m in 4.8s2053: //rb/spec/unit/selenium/webdriver/remote:bridge �[0m�[32mPASSED�[0m in 4.5s2054: //rb/spec/unit/selenium/webdriver/remote:capabilities �[0m�[32mPASSED�[0m in 5.6s2055: //rb/spec/unit/selenium/webdriver/remote:driver �[0m�[32mPASSED�[0m in 4.8s2056: //rb/spec/unit/selenium/webdriver/remote/http:common �[0m�[32mPASSED�[0m in 4.6s2057: //rb/spec/unit/selenium/webdriver/remote/http:curb �[0m�[32mPASSED�[0m in 4.4s2058: //rb/spec/unit/selenium/webdriver/remote/http:default �[0m�[32mPASSED�[0m in 4.8s2059: //rb/spec/unit/selenium/webdriver/safari:driver �[0m�[32mPASSED�[0m in 4.3s2060: //rb/spec/unit/selenium/webdriver/safari:options �[0m�[32mPASSED�[0m in 4.7s2061: //rb/spec/unit/selenium/webdriver/safari:service �[0m�[32mPASSED�[0m in 4.4s2062: //rb/spec/unit/selenium/webdriver/support:color �[0m�[32mPASSED�[0m in 3.5s2063: //rb/spec/unit/selenium/webdriver/support:event_firing �[0m�[32mPASSED�[0m in 5.6s2064: //rb/spec/unit/selenium/webdriver/support:select �[0m�[32mPASSED�[0m in 4.8s2065: //rb/spec/unit/selenium/webdriver/common/interactions:pointer_actions �[0m�[31m�[1mTIMEOUT�[0m in 1800.0s2066: D:/_bazel/execroot/_main/bazel-out/x64_windows-fastbuild/testlogs/rb/spec/unit/selenium/webdriver/common/interactions/pointer_actions/test.log2067: Executed 66 out of 66 tests: 65 tests pass and �[0m�[31m�[1m1 fails locally�[0m.2068: �[0m2069: ##[error]Process completed with exit code 1.2070: Post job cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
🔗 Related Issues
💥 What does this PR do?
This removes a couple of methods that have been deprecated for over 1 year.
🔧 Implementation Notes
💡 Additional Considerations
This will be mentioned in the release notes.
🔄 Types of changes
PR Type
Enhancement, Bug fix
Description
Remove deprecated
setScriptTimeoutandpageLoadTimeoutmethodsUpdate interfaces and implementations to use new timeout methods
Clean up related deprecated code and tests
Add new listener hooks for updated timeout methods
Changes walkthrough 📝
WebDriver.java
Remove deprecated timeout methods from WebDriver interfacejava/src/org/openqa/selenium/WebDriver.java
setScriptTimeoutandpageLoadTimeoutmethods fromTimeoutsscriptTimeout(Duration)andpageLoadTimeout(Duration)DriverCommand.java
Remove deprecated timeout payloads using TimeUnitjava/src/org/openqa/selenium/remote/DriverCommand.java
TimeUnitRemoteWebDriver.java
Remove deprecated timeout methods from RemoteWebDriverjava/src/org/openqa/selenium/remote/RemoteWebDriver.java
TimeoutsimplementationWebDriverListener.java
Add and document new script timeout listener hooksjava/src/org/openqa/selenium/support/events/WebDriverListener.java
beforeScriptTimeoutandafterScriptTimeouthooksbeforeSetScriptTimeoutandafterSetScriptTimeouthooksDecoratedTimeoutsTest.java
Update tests to remove deprecated timeout usagejava/test/org/openqa/selenium/support/decorators/DecoratedTimeoutsTest.java